package writer;

import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;


import com.Ostermiller.util.CSVPrinter;

public class CSVWriter {

	private CSVPrinter csvp;
	private File outputdir;

	public CSVWriter(File textFile) throws IOException{
	// Create the printer
		outputdir= textFile;

	
	
}

	public void write(String[] values) throws IOException{
	// Write to the printer
	csvp.write(values);
	}

	public void write(String string) throws IOException {
		// TODO Auto-generated method stub
		this.printToFile(string);
	}
	



	

	public void printToFile(String line) throws IOException{
		try{
			PrintWriter out = new PrintWriter(new FileOutputStream(this.outputdir,true));
			out.println(line);
			out.close();
		}catch (IOException e){}
		
	}
	
	
	

	   
	
}
